using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ibba.agil.core.common;
using ibba.agil.core;

namespace ibba.agil.data.data
{
    public class tbagi011TipoFortItgrKey : IDataKey
    {
        public string codTipoFortItgr { get; set; }
    }

    public class tbagi011TipoFortItgr_COL : CollectionData<tbagi011TipoFortItgrKey, tbagi011TipoFortItgr_ENT>
    {
        private manager.tbagi011TipoFortItgr_COM _manager;
        private Criteria<CriteriaInfo, object> _pesquisa;

        public tbagi011TipoFortItgr_COL()
        {
            _manager = new manager.tbagi011TipoFortItgr_COM();
        }

        public override List<tbagi011TipoFortItgr_ENT> Find(tbagi011TipoFortItgrKey key)
        {
            #region Implementacao do Criterio de Pesquisa

            _pesquisa = new Criteria<CriteriaInfo, object>(new tbagi011TipoFortItgr_ENT());
            //_pesquisa.Add(new CriteriaInfo()
            //{
            //    EntityData = new tbagi011TipoFortItgr_ENT(),
            //    LikePattern = LikePattern.Both,
            //    LogicalType = LogicalOperator.AND,
            //    NameProperty = "codTipoFortItgr",
            //    SearchType = LogicalComparator.EQUAL
            //}, key.codTipoFortItgr);

            #endregion

            return _manager.Where(CriteriaFind);
        }

        protected override Criteria<CriteriaInfo, object> CriteriaFind()
        {
            return _pesquisa;
        }
    }
}
